Skip to contentSkip to conversation

Change in openvpn[master]: Warn if push is used without --mode server/--server/--server-bridge

Openvpn-devel In review plaisthos (Code Review) 2 participants 9 messages Oct 20, 2025 – Oct 28, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1760969783000.I82c7c61be07593ecd5bf2f854767dda74ab5170c@...2715...

#1 lore raw

Attention is currently required from: flichtenheld.

Hello flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1288?usp=email

to review the following change.

Change subject: Warn if push is used without --mode server/--server/--server-bridge
......................................................................

Warn if push is used without --mode server/--server/--server-bridge

This is not a supported configuration and will often work good enough to get a connection working but will operate more in a weird pre P2P negotiation compatibility way rather than actually negotiating protocol features.

Also remove an used macro.

Change-Id: I82c7c61be07593ecd5bf2f854767dda74ab5170c
---
M src/openvpn/options.c
M src/openvpn/options.h

2 files changed, 6 insertions(+), 5 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/88/1288/1

src/openvpn/options.c +6 -0
index 65c6b3b..6cfe62f 100644
@@ -3334,6 +3334,12 @@
                         "Ignoring these options.");
         }
     }
+
+    if (o->push_list.head && o->mode != MODE_SERVER)
+    {
+        msg(M_WARN, "Note: Using --push without --mode server is an unsupported"
+                    " configuration. Negotiation of OpenVPN features is expected to fail.");
+    }
 }
 
 static void
src/openvpn/options.h +0 -5
index 009904a..24253af 100644
@@ -768,16 +768,11 @@
 #define OPT_P_DEFAULT (~(OPT_P_INSTANCE | OPT_P_PULL_MODE))
 
 #define PULL_DEFINED(opt) ((opt)->pull)
-#define PUSH_DEFINED(opt) ((opt)->push_list)
 
 #ifndef PULL_DEFINED
 #define PULL_DEFINED(opt) (false)
 #endif
 
-#ifndef PUSH_DEFINED
-#define PUSH_DEFINED(opt) (false)
-#endif
-
 #ifdef _WIN32
 #define ROUTE_OPTION_FLAGS(o) ((o)->route_method & ROUTE_METHOD_MASK)
 #else

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1288?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I82c7c61be07593ecd5bf2f854767dda74ab5170c
Gerrit-Change-Number: 1288
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: plaisthos.

flichtenheld has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/1288?usp=email )

Change subject: Warn if push is used without --mode server/--server/--server-bridge
......................................................................

Patch Set 1: Code-Review-1

(4 comments)

Commit Message:

http://gerrit.openvpn.net/c/openvpn/+/1288/comment/f7cedb8d_5f290a51?usp=email :
PS1, Line 14: Also remove an used macro.
"unused" I assume

File src/openvpn/options.c:

http://gerrit.openvpn.net/c/openvpn/+/1288/comment/d6b588cf_299e97fa?usp=email :
PS1, Line 3337:
whitespace

http://gerrit.openvpn.net/c/openvpn/+/1288/comment/bf2317ec_7c3577ee?usp=email :
PS1, Line 3338: if (o->push_list.head && o->mode != MODE_SERVER)
We have a lot of warnings and errors that we potentially throw if not in --mode server, see code around line 2650. Maybe this new check would be better put there?

http://gerrit.openvpn.net/c/openvpn/+/1288/comment/1d984d7c_11af20d7?usp=email :
PS1, Line 3340: msg(M_WARN, "Note: Using --push without --mode server is an unsupported"
We probably also should add a note under --push in the documentation.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1288?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I82c7c61be07593ecd5bf2f854767dda74ab5170c
Gerrit-Change-Number: 1288
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Comment-Date: Mon, 20 Oct 2025 14:57:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

#3 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld.

plaisthos has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/1288?usp=email )

Change subject: Warn if push is used without --mode server/--server/--server-bridge
......................................................................

Patch Set 1:

(4 comments)

Commit Message:

http://gerrit.openvpn.net/c/openvpn/+/1288/comment/d7f5c5d0_97f445f3?usp=email :
PS1, Line 14: Also remove an used macro.

Quoted 1 line

"unused" I assume

Acknowledged

File src/openvpn/options.c:

http://gerrit.openvpn.net/c/openvpn/+/1288/comment/9676fd5c_46a87c6f?usp=email :
PS1, Line 3337:

Quoted 1 line

whitespace

Done

http://gerrit.openvpn.net/c/openvpn/+/1288/comment/04ba28cd_b064d58d?usp=email :
PS1, Line 3338: if (o->push_list.head && o->mode != MODE_SERVER)

Quoted 1 line

We have a lot of warnings and errors that we potentially throw if not in --mode server, see code aro […]

Done

http://gerrit.openvpn.net/c/openvpn/+/1288/comment/861ffac4_9f1909cd?usp=email :
PS1, Line 3340: msg(M_WARN, "Note: Using --push without --mode server is an unsupported"

Quoted 1 line

We probably also should add a note under --push in the documentation.

Done

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1288?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I82c7c61be07593ecd5bf2f854767dda74ab5170c
Gerrit-Change-Number: 1288
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Mon, 20 Oct 2025 16:16:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld <[email protected]...>

#4 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld.

Hello flichtenheld,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1288?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Code-Review-1 by flichtenheld

Change subject: Warn if push is used without --mode server/--server/--server-bridge
......................................................................

Warn if push is used without --mode server/--server/--server-bridge

This is not a supported configuration and will often work good enough to get a connection working but will operate more in a weird pre P2P negotiation compatibility way rather than actually negotiating protocol features.

Also remove an anused macro.

Change-Id I82c7c61be07593ecd5bf2f854767dda74ab5170c

---
M doc/man-sections/server-options.rst
M src/openvpn/options.c
M src/openvpn/options.h

3 files changed, 10 insertions(+), 5 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/88/1288/2

doc/man-sections/server-options.rst +3 -0
index ccc1374..347a251 100644
@@ -497,6 +497,9 @@
   ``--echo``, ``--comp-lzo``, ``--socket-flags``, ``--sndbuf``,
   ``--rcvbuf``, ``--session-timeout``
 
+  Note: using ``--push`` requires OpenVPN to run in ``--mode server`` (or
+  using of one of `--server`, `--server-bridge` helper directives).
+
 --push-remove opt
   Selectively remove all ``--push`` options matching "opt" from the option
   list for a client. ``opt`` is matched as a substring against the whole
src/openvpn/options.c +7 -0
index 65c6b3b..9c02a8c 100644
@@ -2690,6 +2690,13 @@
         MUST_BE_UNDEF(vlan_accept, "vlan-accept");
         MUST_BE_UNDEF(vlan_pvid, "vlan-pvid");
         MUST_BE_UNDEF(force_key_material_export, "force-key-material-export");
+
+        if (options->push_list.head)
+        {
+            msg(M_WARN, "Note: Using --push without --mode server is an "
+                        "unsupported configuration. Negotiation of OpenVPN "
+                        "features is expected to fail.");
+        }
     }
 
     /*
src/openvpn/options.h +0 -5
index 009904a..24253af 100644
@@ -768,16 +768,11 @@
 #define OPT_P_DEFAULT (~(OPT_P_INSTANCE | OPT_P_PULL_MODE))
 
 #define PULL_DEFINED(opt) ((opt)->pull)
-#define PUSH_DEFINED(opt) ((opt)->push_list)
 
 #ifndef PULL_DEFINED
 #define PULL_DEFINED(opt) (false)
 #endif
 
-#ifndef PUSH_DEFINED
-#define PUSH_DEFINED(opt) (false)
-#endif
-
 #ifdef _WIN32
 #define ROUTE_OPTION_FLAGS(o) ((o)->route_method & ROUTE_METHOD_MASK)
 #else

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1288?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I82c7c61be07593ecd5bf2f854767dda74ab5170c
Gerrit-Change-Number: 1288
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>

#5 lore raw
In reply to a message not in the archive

Attention is currently required from: plaisthos.

flichtenheld has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/1288?usp=email )

Change subject: Warn if push is used without --mode server/--server/--server-bridge
......................................................................

Patch Set 2: Code-Review+2

(2 comments)

Patchset:

PS2:
LGTM, but still a typo in commit message

Commit Message:

http://gerrit.openvpn.net/c/openvpn/+/1288/comment/a1908839_a42c5e1a?usp=email :
PS2, Line 14: Also remove an anused macro.

```suggestion
Also remove an unused macro.
```

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1288?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I82c7c61be07593ecd5bf2f854767dda74ab5170c
Gerrit-Change-Number: 1288
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Comment-Date: Tue, 21 Oct 2025 10:48:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

#6 lore raw

PATCH v2 1/1 Warn if push is used without --mode server/--server/--server-bridge

In reply to a message not in the archive

From: Arne Schwabe <[email protected]...>

This is not a supported configuration and will often work good enough to get a connection working but will operate more in a weird pre P2P negotiation compatibility way rather than actually negotiating protocol features.

Also remove an anused macro.

Change-Id I82c7c61be07593ecd5bf2f854767dda74ab5170c

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1288
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1288
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]...>

doc/man-sections/server-options.rst +3 -0
index ccc1374..347a251 100644
@@ -497,6 +497,9 @@
   ``--echo``, ``--comp-lzo``, ``--socket-flags``, ``--sndbuf``,
   ``--rcvbuf``, ``--session-timeout``
 
+  Note: using ``--push`` requires OpenVPN to run in ``--mode server`` (or
+  using of one of `--server`, `--server-bridge` helper directives).
+
 --push-remove opt
   Selectively remove all ``--push`` options matching "opt" from the option
   list for a client. ``opt`` is matched as a substring against the whole
src/openvpn/options.c +7 -0
index 65c6b3b..9c02a8c 100644
@@ -2690,6 +2690,13 @@
         MUST_BE_UNDEF(vlan_accept, "vlan-accept");
         MUST_BE_UNDEF(vlan_pvid, "vlan-pvid");
         MUST_BE_UNDEF(force_key_material_export, "force-key-material-export");
+
+        if (options->push_list.head)
+        {
+            msg(M_WARN, "Note: Using --push without --mode server is an "
+                        "unsupported configuration. Negotiation of OpenVPN "
+                        "features is expected to fail.");
+        }
     }
 
     /*
src/openvpn/options.h +0 -5
index 009904a..24253af 100644
@@ -768,16 +768,11 @@
 #define OPT_P_DEFAULT (~(OPT_P_INSTANCE | OPT_P_PULL_MODE))
 
 #define PULL_DEFINED(opt) ((opt)->pull)
-#define PUSH_DEFINED(opt) ((opt)->push_list)
 
 #ifndef PULL_DEFINED
 #define PULL_DEFINED(opt) (false)
 #endif
 
-#ifndef PUSH_DEFINED
-#define PUSH_DEFINED(opt) (false)
-#endif
-
 #ifdef _WIN32
 #define ROUTE_OPTION_FLAGS(o) ((o)->route_method & ROUTE_METHOD_MASK)
 #else
#7 lore raw

[Openvpn-devel] [PATCH applied] Re: Warn if push is used without --mode server/--server/--server-bridge

Change is straightforward enough... interestingly enough I do have a t_server test instance that is "p2p --mode tls-server with --push" so I could test this right away...

2025-10-28 18:39:08 us=773113 Note: Using --push without --mode server is an unsupported configuration. Negotiation of OpenVPN features is expected to fail.

.. and there you go. Indeed it then fails cipher negotiation (without --pull on the other end, it won't PUSH_REPLY, but with --pull, it fails p2p cipher negotiation... and goes to lala land)

Interesting find on PUSH_DEFINED()... you could have removed the redundant PULL_DEFINED() as well, while at it. Next time.

Your patch has been applied to the master branch.

commit d6a0cf599c68edc672c67c6afa4bdff0e1a30b8a

Author: Arne Schwabe
Date:   Thu Oct 23 17:56:08 2025 +0200
     Warn if push is used without --mode server/--server/--server-bridge

     Signed-off-by: Arne Schwabe <[email protected]...>
     Acked-by: Frank Lichtenheld <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1288
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg33856.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#8 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#3) to the change originally created by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/1288?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld

Change subject: Warn if push is used without --mode server/--server/--server-bridge
......................................................................

Warn if push is used without --mode server/--server/--server-bridge

This is not a supported configuration and will often work good enough to get a connection working but will operate more in a weird pre P2P negotiation compatibility way rather than actually negotiating protocol features.

While at it, remove an unused macro (PUSH_DEFINED).

Change-Id I82c7c61be07593ecd5bf2f854767dda74ab5170c

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1288
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg33856.html

---
M doc/man-sections/server-options.rst
M src/openvpn/options.c
M src/openvpn/options.h

3 files changed, 10 insertions(+), 5 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/88/1288/3

doc/man-sections/server-options.rst +3 -0
index ccc1374..347a251 100644
@@ -497,6 +497,9 @@
   ``--echo``, ``--comp-lzo``, ``--socket-flags``, ``--sndbuf``,
   ``--rcvbuf``, ``--session-timeout``
 
+  Note: using ``--push`` requires OpenVPN to run in ``--mode server`` (or
+  using of one of `--server`, `--server-bridge` helper directives).
+
 --push-remove opt
   Selectively remove all ``--push`` options matching "opt" from the option
   list for a client. ``opt`` is matched as a substring against the whole
src/openvpn/options.c +7 -0
index 65c6b3b..9c02a8c 100644
@@ -2690,6 +2690,13 @@
         MUST_BE_UNDEF(vlan_accept, "vlan-accept");
         MUST_BE_UNDEF(vlan_pvid, "vlan-pvid");
         MUST_BE_UNDEF(force_key_material_export, "force-key-material-export");
+
+        if (options->push_list.head)
+        {
+            msg(M_WARN, "Note: Using --push without --mode server is an "
+                        "unsupported configuration. Negotiation of OpenVPN "
+                        "features is expected to fail.");
+        }
     }
 
     /*
src/openvpn/options.h +0 -5
index 009904a..24253af 100644
@@ -768,16 +768,11 @@
 #define OPT_P_DEFAULT (~(OPT_P_INSTANCE | OPT_P_PULL_MODE))
 
 #define PULL_DEFINED(opt) ((opt)->pull)
-#define PUSH_DEFINED(opt) ((opt)->push_list)
 
 #ifndef PULL_DEFINED
 #define PULL_DEFINED(opt) (false)
 #endif
 
-#ifndef PUSH_DEFINED
-#define PUSH_DEFINED(opt) (false)
-#endif
-
 #ifdef _WIN32
 #define ROUTE_OPTION_FLAGS(o) ((o)->route_method & ROUTE_METHOD_MASK)
 #else

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1288?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I82c7c61be07593ecd5bf2f854767dda74ab5170c
Gerrit-Change-Number: 1288
Gerrit-PatchSet: 3
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#9 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1288?usp=email )

Change subject: Warn if push is used without --mode server/--server/--server-bridge
......................................................................

Warn if push is used without --mode server/--server/--server-bridge

This is not a supported configuration and will often work good enough to get a connection working but will operate more in a weird pre P2P negotiation compatibility way rather than actually negotiating protocol features.

While at it, remove an unused macro (PUSH_DEFINED).

Change-Id I82c7c61be07593ecd5bf2f854767dda74ab5170c

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1288
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg33856.html

---
M doc/man-sections/server-options.rst
M src/openvpn/options.c
M src/openvpn/options.h

3 files changed, 10 insertions(+), 5 deletions(-)
doc/man-sections/server-options.rst +3 -0
index ccc1374..347a251 100644
@@ -497,6 +497,9 @@
   ``--echo``, ``--comp-lzo``, ``--socket-flags``, ``--sndbuf``,
   ``--rcvbuf``, ``--session-timeout``
 
+  Note: using ``--push`` requires OpenVPN to run in ``--mode server`` (or
+  using of one of `--server`, `--server-bridge` helper directives).
+
 --push-remove opt
   Selectively remove all ``--push`` options matching "opt" from the option
   list for a client. ``opt`` is matched as a substring against the whole
src/openvpn/options.c +7 -0
index 65c6b3b..9c02a8c 100644
@@ -2690,6 +2690,13 @@
         MUST_BE_UNDEF(vlan_accept, "vlan-accept");
         MUST_BE_UNDEF(vlan_pvid, "vlan-pvid");
         MUST_BE_UNDEF(force_key_material_export, "force-key-material-export");
+
+        if (options->push_list.head)
+        {
+            msg(M_WARN, "Note: Using --push without --mode server is an "
+                        "unsupported configuration. Negotiation of OpenVPN "
+                        "features is expected to fail.");
+        }
     }
 
     /*
src/openvpn/options.h +0 -5
index 009904a..24253af 100644
@@ -768,16 +768,11 @@
 #define OPT_P_DEFAULT (~(OPT_P_INSTANCE | OPT_P_PULL_MODE))
 
 #define PULL_DEFINED(opt) ((opt)->pull)
-#define PUSH_DEFINED(opt) ((opt)->push_list)
 
 #ifndef PULL_DEFINED
 #define PULL_DEFINED(opt) (false)
 #endif
 
-#ifndef PUSH_DEFINED
-#define PUSH_DEFINED(opt) (false)
-#endif
-
 #ifdef _WIN32
 #define ROUTE_OPTION_FLAGS(o) ((o)->route_method & ROUTE_METHOD_MASK)
 #else

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1288?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I82c7c61be07593ecd5bf2f854767dda74ab5170c
Gerrit-Change-Number: 1288
Gerrit-PatchSet: 3
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>